#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  onethr.py
#       Author @  Huoty
#  Create date @  2015-07-27 15:06:27
#  Description @  
# *************************************************************

import thread
from time import sleep, ctime

def loop0():
    print "start loop 0 at:", ctime()
    sleep(4)
    print "loop 0 done at:", ctime()

def loop1():
    print "start loop 1 at:", ctime()
    sleep(2)
    print "loop 1 done at:", ctime()

def main():
    print "starting at:", ctime()
    thread.start_new_thread(loop0,())
    thread.start_new_thread(loop1,())
    sleep(6)
    print "all DONE at:", ctime()


# Script starts from here

if __name__ == "__main__":
    main()

